#include<iostream>

using namespace std;
long long t,m,n;
int main()
{
    cin>>t;
    while(t--){
        cin>>m>>n;
        if(m==1||n==1||(m==2&&n==2)) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}
